<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>login</title>
<!-- 引入样式 -->
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
<style>
body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(-135deg,#c850c0,#4158d0);
}
.wrapper {
    width: 450px;
    background: #fff;
    padding: 30px;
    box-shadow:0px 0px 10px rgba(0,0,0,0.1) ;
}    
.input-data {
    height: 40px;
    width: 100%;
    position: relative;
}

.input-data input {
    height: 100%;
    width: 100%;
    border: none;
    border-radius: 0%;
    padding: 0;
    line-height: 26px;
    border-bottom: 2px solid silver;
}

.input-data input:focus {
   
}

/* .input-data .el-form-item__content label {
    position: absolute;
    bottom: 30px;
    left: 0px;
    color: grey;
    pointer-events: none;
    transition: all 0.3s ease;
} */
 .underline {
    position: absolute;
    bottom:11px;
    height: 2px;
    width: 100%;    
}

.underline:before {
    position: absolute;
    content: '';
    height: 100%;
    width: 100%;
    background:red;
    transform: scaleX(0);
    transition: transform 0.3s ease;    
}
.input-data input:focus~.underline:before {
    transform: scaleX(1);
}


</style>    
</head>
<body>
<div id="loginbox">
    <div class="wrapper">
        <el-form ref="form" :model="form"  >
            <el-form-item label='name' class="input-data"  >
                <el-input   v-model="form.name"></el-input>
                <div class="underline"></div>
            </el-form-item>       
        </el-form>
    </div>

</div>
    

    
</body>
<!-- 引入组件库 -->
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
<script>
new Vue({
        el:'#loginbox',
        data() {
            return {
                form:{
                    name:''
                }
            }
        }
    })
</script>

</html>